public class IsInterrupted {

    public static void main(String[] args) {
        Thread thread1 = new Thread(){
            @Override
            public void run() {
                for (int i = 0; i < 5; i++) {
                    System.out.println(Thread.interrupted());
                }
            }
        };
        thread1.start();
        thread1.interrupt();
        Thread thread2 = new Thread(){
            @Override
            public void run() {
                for (int i = 0; i < 5; i++) {
                    System.out.println(Thread.currentThread().isInterrupted());
                }
            }
        };
        thread2.start();
        thread2.interrupt();
    }
}